package dyyx.drools.test;

public class ScoreHandler {

	
	
	public void buildGrade(RuleContext context){
		int score = context.getScore();
		
		context.setGrade(getGrade(score));
	}
	
	
	public static String getGrade(int score){
		
		if(score>=90){
			return "A";
		}
		if(score>=80){
			return "B";
		}
		if(score>=70){
			return "C";
		}
		if(score>=60){
			return "D";
		}
		if(score>=10){
			return "E";
		}
		
		return "F";
		
	}

}